﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using App1AppHandler;

namespace Reborn_WorldServer.App1AppHandler
{
    public class PendingBindRequest : PendingUserInput
    {
        public PendingBindRequest(Character character, string message)
            : base(character)
        {
            List<string> choices = new List<string>();
            choices.Add("Yes");
            choices.Add("No");

            base.sendRequest(new PendingUserInputData("Bind Spirit", message, choices, "No"));
            base.startExpireTimer(15000);
        }

        public override bool processResult(string choice)
        {
            if (base.processResult(choice) == false || choice == "No")
                return false;

            parentCharacter.BindMapID = parentCharacter.MapID;
            parentCharacter.BindMapX = parentCharacter.MapX;
            parentCharacter.BindMapY = parentCharacter.MapY;
            parentCharacter.SendMessage("Your spirit is now bound to your current location.", "server");

            return true;
        }
    }
}
